package tgc.edu.xzy.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="xzy_tbclass")   
public class TbClass {
	private Integer id;
	private String name;
	private String bzr;
	private List<Student> list = new ArrayList<>();
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getBzr() {
		return bzr;
	}
	public void setBzr(String bzr) {
		this.bzr = bzr;
	}
	
	@OneToMany(cascade=CascadeType.ALL,mappedBy="tbClass")
	public List<Student> getList() {
		return list;
	}
	public void setList(List<Student> list) {
		this.list = list;
	}
	public TbClass(Integer id, String name, String bzr, List<Student> list) {
		super();
		this.id = id;
		this.name = name;
		this.bzr = bzr;
		this.list = list;
	}
	public TbClass() {
		super();
	}
	
	
}
